using HKB.Common;
using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Diagnostics;
namespace HKB.Data.Dal.Shop_ShopOwnerCategoryTableAdapters
{
	[GeneratedCode("System.Data.Design.TypedDataSetGenerator", "2.0.0.0"), DataObject(true), HelpKeyword("vs.data.TableAdapter"), Designer("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), DesignerCategory("code"), ToolboxItem(true)]
	public class HLShop_ShopOwnerCategoryTableAdapter : Component
	{
		private SqlDataAdapter _adapter;
		private SqlConnection _connection;
		private SqlCommand[] _commandCollection;
		private bool _clearBeforeFill;
		[System.Diagnostics.DebuggerNonUserCode]
		private SqlDataAdapter Adapter
		{
			get
			{
				if (this._adapter == null)
				{
					this.InitAdapter();
				}
				return this._adapter;
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		internal SqlConnection Connection
		{
			get
			{
				if (this._connection == null)
				{
					this.InitConnection();
				}
				return this._connection;
			}
			set
			{
				this._connection = value;
				if (this.Adapter.InsertCommand != null)
				{
					this.Adapter.InsertCommand.Connection = value;
				}
				if (this.Adapter.DeleteCommand != null)
				{
					this.Adapter.DeleteCommand.Connection = value;
				}
				if (this.Adapter.UpdateCommand != null)
				{
					this.Adapter.UpdateCommand.Connection = value;
				}
				for (int i = 0; i < this.CommandCollection.Length; i++)
				{
					if (this.CommandCollection[i] != null)
					{
						this.CommandCollection[i].Connection = value;
					}
				}
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		protected SqlCommand[] CommandCollection
		{
			get
			{
				if (this._commandCollection == null)
				{
					this.InitCommandCollection();
				}
				return this._commandCollection;
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		public bool ClearBeforeFill
		{
			get
			{
				return this._clearBeforeFill;
			}
			set
			{
				this._clearBeforeFill = value;
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		public HLShop_ShopOwnerCategoryTableAdapter()
		{
			this.ClearBeforeFill = true;
		}
		[System.Diagnostics.DebuggerNonUserCode]
		private void InitAdapter()
		{
			this._adapter = new SqlDataAdapter();
			DataTableMapping dataTableMapping = new DataTableMapping();
			dataTableMapping.SourceTable = "Table";
			dataTableMapping.DataSetTable = "HLShop_ShopOwnerCategory";
			dataTableMapping.ColumnMappings.Add("CategoryID", "CategoryID");
			dataTableMapping.ColumnMappings.Add("CategoryName", "CategoryName");
			dataTableMapping.ColumnMappings.Add("ShopID", "ShopID");
			dataTableMapping.ColumnMappings.Add("ParentID", "ParentID");
			this._adapter.TableMappings.Add(dataTableMapping);
			this._adapter.InsertCommand = new SqlCommand();
			this._adapter.InsertCommand.Connection = this.Connection;
			this._adapter.InsertCommand.CommandText = "INSERT INTO [HLShop_ShopOwnerCategory] ([CategoryName], [ShopID], [ParentID]) VALUES (@CategoryName, @ShopID, @ParentID)";
			this._adapter.InsertCommand.CommandType = CommandType.Text;
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@CategoryName", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "CategoryName", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@ShopID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "ShopID", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@ParentID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "ParentID", DataRowVersion.Current, false, null, "", "", ""));
		}
		[System.Diagnostics.DebuggerNonUserCode]
		private void InitConnection()
		{
			this._connection = new SqlConnection();
			this._connection.ConnectionString = Conn.CurrenConnectionStrings;
		}
		[System.Diagnostics.DebuggerNonUserCode]
		private void InitCommandCollection()
		{
			this._commandCollection = new SqlCommand[1];
			this._commandCollection[0] = new SqlCommand();
			this._commandCollection[0].Connection = this.Connection;
			this._commandCollection[0].CommandText = "SELECT CategoryID, CategoryName, ShopID, ParentID\r\nFROM HLShop_ShopOwnerCategory\r\nWHERE (ShopID = @ShopID)";
			this._commandCollection[0].CommandType = CommandType.Text;
			this._commandCollection[0].Parameters.Add(new SqlParameter("@ShopID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "ShopID", DataRowVersion.Current, false, null, "", "", ""));
		}
		[DataObjectMethod(DataObjectMethodType.Fill, true), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Fill(Shop_ShopOwnerCategory.HLShop_ShopOwnerCategoryDataTable dataTable, int? ShopID)
		{
			this.Adapter.SelectCommand = this.CommandCollection[0];
			if (ShopID.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[0].Value = ShopID.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[0].Value = System.DBNull.Value;
			}
			if (this.ClearBeforeFill)
			{
				dataTable.Clear();
			}
			return this.Adapter.Fill(dataTable);
		}
		[DataObjectMethod(DataObjectMethodType.Select, true), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual Shop_ShopOwnerCategory.HLShop_ShopOwnerCategoryDataTable GetShopOwnerCategoryByShopID(int? ShopID)
		{
			this.Adapter.SelectCommand = this.CommandCollection[0];
			if (ShopID.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[0].Value = ShopID.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[0].Value = System.DBNull.Value;
			}
			Shop_ShopOwnerCategory.HLShop_ShopOwnerCategoryDataTable hLShop_ShopOwnerCategoryDataTable = new Shop_ShopOwnerCategory.HLShop_ShopOwnerCategoryDataTable();
			this.Adapter.Fill(hLShop_ShopOwnerCategoryDataTable);
			return hLShop_ShopOwnerCategoryDataTable;
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(Shop_ShopOwnerCategory.HLShop_ShopOwnerCategoryDataTable dataTable)
		{
			return this.Adapter.Update(dataTable);
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(Shop_ShopOwnerCategory dataSet)
		{
			return this.Adapter.Update(dataSet, "HLShop_ShopOwnerCategory");
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(DataRow dataRow)
		{
			return this.Adapter.Update(new DataRow[]
			{
				dataRow
			});
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(DataRow[] dataRows)
		{
			return this.Adapter.Update(dataRows);
		}
	}
}
